package com.sun.apilimitrate.controller;

import com.sun.apilimitrate.annotation.RateLimit;
import com.sun.apilimitrate.dto.Result;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @RateLimit(key = "api:demo", rate = 1, message = "演示接口请求过于频繁")
    @GetMapping("/api/demo")
    public Result demo() {
        return new Result(false, "Hello, World!");
    }
}